package a.e.b.a;

import a.e.b.b.a;
import a.e.b.b.t;
import a.e.b.c.b;
import a.e.b.c.cb;
import a.e.b.c.o;
import a.i.jb;
import a.i.n;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;

class s
{
  public static final String a = "y.io.graphml.graph2d.UserDataSupport.IGNORE_STRING_CONVERSION_ERRORS";
  
  public static void a(Object paramObject, o paramo, cb paramcb, jb paramjb)
    throws b
  {
    if (paramObject != null)
    {
      String str = null;
      try
      {
        str = paramjb.a(paramObject, paramObject.getClass());
      }
      catch (IllegalArgumentException localIllegalArgumentException)
      {
        if (!i.i)
        {
          if (y.a(paramo, "y.io.graphml.graph2d.UserDataSupport.IGNORE_STRING_CONVERSION_ERRORS")) {
            n.a("Could not write userdata: " + localIllegalArgumentException.getMessage());
          }
        }
        else {
          return;
        }
      }
      throw new b("Error serializing userdata", localIllegalArgumentException);
      paramcb.a("UserData", "http://www.yworks.com/xml/graphml").c("class", paramObject.getClass().getName()).c("value", str).b();
    }
  }
  
  public static Object a(Node paramNode, t paramt, jb paramjb)
    throws a
  {
    boolean bool = i.i;
    NamedNodeMap localNamedNodeMap = paramNode.getAttributes();
    Node localNode = localNamedNodeMap.getNamedItem("class");
    String str1 = null;
    if ((bool) || (localNode != null)) {
      str1 = localNode.getNodeValue();
    }
    localNode = localNamedNodeMap.getNamedItem("value");
    String str2 = null;
    if ((bool) || (localNode != null)) {
      str2 = localNode.getNodeValue();
    }
    String str3;
    try
    {
      return paramjb.a(str2, Class.forName(str1));
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      str3 = "Could not parse userdata " + str2 + ": " + localIllegalArgumentException.getMessage();
      if (!bool)
      {
        if (y.a(paramt, "y.io.graphml.graph2d.UserDataSupport.IGNORE_STRING_CONVERSION_ERRORS")) {
          n.a(str3);
        }
      }
      else {
        return null;
      }
      throw new a(str3, localIllegalArgumentException);
    }
    catch (ClassNotFoundException localClassNotFoundException)
    {
      str3 = "Could not parse userdata " + str2 + ": " + localClassNotFoundException.getMessage();
      if (!bool)
      {
        if (y.a(paramt, "y.io.graphml.graph2d.UserDataSupport.IGNORE_STRING_CONVERSION_ERRORS")) {
          n.a(str3);
        }
      }
      else {
        return null;
      }
    }
    throw new a(str3, localClassNotFoundException);
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.e.b.a.s
 * JD-Core Version:    0.7.0.1
 */